package com.kele.auth.feign;

import com.kele.auth.feign.fallback.UserClientFactory;
import com.kele.auth.util.SecurityUtil;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Description:
 * @Author: Kele
 * @CreateDate: 2023/4/23 18:24
 * @Version:
 */
@FeignClient(value = "system-service", fallback = UserClientFactory.class)
@RequestMapping("/system")
public interface UserFeignClient {

    @PostMapping(value = "/user/getUser")
    SecurityUtil.User getUserByUsername(String username);

    @PostMapping(value = "/user/getAuthorities")
    List<String> getAuthorities(String userId);
}
